<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
  
</head>
<style>
  /* 实际项目中加这个样式 */
    *, *::before, *::after {
      padding: 0;
      margin: 0;
      box-sizing: border-box;
    }
/* 实际项目中加这个样式 */
    body {
        width: 100vw;
        height: 100vh;
        background: #34495e;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .card{
      width: 300px;
      height: 200px;
      background-color: red;
      display: flex;
      justify-content: center;
      align-items: center;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      font-weight: bold;
      position: relative;
      transform-style: preserve-3d;
      transform: perspective(900px) rotateX(45deg) rotateY(15deg);
    }
    .card::before,.card::after{
      width:50%;
      height: 100%;
      position: absolute;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: aqua;
      transition: all 1s;
    }
    .card::after{
      content: "快乐";
      right: 0;
      transform-origin: right;
      border-left: 2px solid red;
    }
    .card::before{
      content: "新年";
      left: 0;
      transform-origin: left;
      border-right: 2px solid #000;
    }
    /* 不能.card::before:hover和.card::after:hover这样写，不起作用 */
    .card:hover::before{
      transform:rotateY(-120deg)
    }
    .card:hover::after{
      transform:rotateY(120deg)
    }
</style>
<body>
  <div class="card">houdunren</div>
</body>
<script>
    

    
</script>
</html>
